package blt.app_core.api.login;

import blt.app_core.api.base.bean.State;
import blt.app_core.api.login.bean.Cookie;
import blt.app_core.api.login.bean.User;
import blt.app_core.utils.UriProdiver;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;

/**
 * Created by xgp on 2017/6/17.
 */

public interface LoginService {

    @POST(UriProdiver.GET_VERCODE)
    @FormUrlEncoded
    Call<State> getVerCode(@Field("phone") String phone);

    @POST(UriProdiver.REGISTER)
    @FormUrlEncoded
    Call<State<Cookie>> register(@Field("mobile") String mobile, @Field("validCode") String verCode,
                                 @Field("password") String password);

    @POST(UriProdiver.LOGIN)
    @FormUrlEncoded
    Call<State<Cookie>> login(@Field("mobile") String mmobile, @Field("password") String password);


    @POST(UriProdiver.LOGOUT)
    Call<State> logOut();

    @POST(UriProdiver.FORGET_PASSWORD)
    @FormUrlEncoded
    Call<State<Cookie>> forgetPwd(@Field("mobile") String mobile, @Field("password") String password,
                                  @Field("validCode") String verCode);

    @POST(UriProdiver.MODIFY_PASSWORD)
    @FormUrlEncoded
    Call<State<Cookie>> modifyPwd(@Field("mobile") String mobile, @Field("password") String password);

    @POST(UriProdiver.MODIFY_NICKNAME)
    @FormUrlEncoded
    Call<State<String>> modifyNick(@Field("nickName") String nickName);

    @GET(UriProdiver.GET_USER_INFO)
    Call<State<User>>  getUserInfo();
}
